<template>
  <div id="map-container" class="map-container">
    <transition name="el-zoom-in-top">
      <div v-show="mapIframe" v-loading="xzViewLoading" class="map-iframe">
        <div class="shenchaButton">
          <!-- <el-button type="primary" size="mini">审查意见</el-button> -->
          <el-button size="mini" @click="closeXzView">关闭</el-button>
        </div>

        <div class="mapBox_left" style="width:100%;height:100%;">
          <iframe
            v-if="loadIfram == 2"
            id="wode"
            :src="xzViewPath"
            frameborder="0"
            style="width: 100%; height: 100%;"
          />
        </div>
      </div>
    </transition>

    <l-map
      ref="map"
      class="map-right"
      style="height: 100%"
      :zoom="$config.mapBaseConfig.zoom"
      :center="$config.mapBaseConfig.center"
      :min-zoom="$config.mapBaseConfig.minZoom"
      :max-zoom="$config.mapBaseConfig.maxZoom"
      :crs="$config.mapBaseConfig.crs"
      :options="{
        zoomControl: false
      }"
    >
      <div v-show="isShowControls != false">
        <l-tile-layer v-if="mapMode == 'sl'" :url="$config.mapLayers.cqVec.tileUrl" />
        <l-layer-group v-if="mapMode == 'yx'">
          <l-tile-layer :url="$config.mapLayers.cqImg.tileUrl" />
          <l-tile-layer :url="$config.mapLayers.cqMark.tileUrl" />
        </l-layer-group>
      </div>

      <l-tile-layer v-for="(value, key, index) in treeCheckedObj" :key="key" :url="value.tileUrl" />

      <l-feature-group ref="features">
        <l-popup class="tdMap-popup-box" :options="{ height: 400, minWidth: 500 }" />
      </l-feature-group>

      <l-geo-json
        v-for="(item, index) in hxData"
        :key="index"
        ref="geoJson"
        :options-style="polygonStyleMap.defaultStyle"
        :geojson="item"
      />
    </l-map>

    <!-- 地图模式切换 s -->
    <div v-show="isShowControls != false" class="map-mode">
      <div class="map-mode-item sl" @click.stop="changeMapMode('sl')">
        <div class="text">矢量</div>
      </div>
      <div class="map-mode-item yx" @click.stop="changeMapMode('yx')">
        <div class="text">影像</div>
      </div>
    </div>
    <!-- 地图模式切换 e -->

    <div class="map-box">
      <!-- 地图工具栏 s -->
      <div v-show="isShowControls != false" class="map-tools">
        <div
          title="图层"
          :class="{ 'map-tools-item line': true, active: toolsValue.layer }"
          @click="handleToolsSwitch('layer')"
        >
          <svg-icon
            class="svg-icon"
            :icon-class="!toolsValue.layer ? 'chy-icon-nav' : 'chy-icon-nav-active'"
          />
          <!-- <i class="chy-icon-nav"></i> -->
        </div>

        <div
          id="lineMeasure"
          title="测距"
          :class="{ 'map-tools-item line': true, active: toolsValue.ruler }"
          @click="handleToolsSwitch('ruler')"
        >
          <svg-icon
            class="svg-icon"
            :icon-class="!toolsValue.ruler ? 'chy-icon-celiang' : 'chy-icon-celiang-active'"
          />
          <!-- <i class="chy-icon-celiang"></i> -->
        </div>

        <div
          id="areaMeasure"
          title="面积测量"
          :class="{ 'map-tools-item line': true, active: toolsValue.area }"
          @click="handleToolsSwitch('area')"
        >
          <svg-icon
            class="svg-icon"
            :icon-class="!toolsValue.area ? 'chy-icon-mianji' : 'chy-icon-mianji-active'"
          />
          <!-- <i class="chy-icon-mianji"></i> -->
        </div>

        <div
          title="卷帘对比"
          :class="{ 'map-tools-item line': true, active: toolsValue.cut }"
          @click="openSideBySidePopup"
        >
          <svg-icon
            class="svg-icon"
            :icon-class="!toolsValue.cut ? 'chy-icon-juanlian' : 'chy-icon-juanlian-active'"
          />
          <!-- <i class="chy-icon-juanlian"></i> -->
        </div>

        <div id="browserPrint" class="map-tools-item line" title="打印">
          <svg-icon class="svg-icon" icon-class="chy-icon-dayin" />
          <!-- <i class="chy-icon-dayin"></i> -->
        </div>

        <div
          :title="isFullScreen == true ? '退出全屏' : '全屏'"
          class="map-tools-item line"
          @click.stop="handleFullScreen"
        >
          <!-- <i :class="isFullScreen == true ? 'chy-icon-tuichuquanping' : 'chy-icon-quanping'"></i> -->
          <svg-icon class="svg-icon" icon-class="chy-icon-quanping" />
          <!-- <i class="chy-icon-quanping"></i> -->
        </div>

        <div class="map-tools-item line" title="清除测距、面积测量" @click.stop="handleClear">
          <svg-icon class="svg-icon" icon-class="chy-icon-qingchu" />
          <!-- <i class="chy-icon-qingchu"></i> -->
        </div>
      </div>
      <!-- 地图工具栏 e -->

      <!-- 审查栏 s -->
      <el-button-group class="map-button-group">
        <slot name="buttonGroup" />
        <el-button class="line" size="medium" @click="handleScView(true)">项目审查</el-button>
      </el-button-group>
      <!-- 审查栏 s -->
    </div>

    <!-- 地图图层 s -->
    <transition name="el-zoom-in-top">
      <div v-show="toolsValue.layer" class="map-layer">
        <el-collapse v-model="collapseValue">
          <el-collapse-item v-for="(item, index) in $config.treeData" :key="index" name="1">
            <template slot="title">
              <div class="map-layer-title">{{ item.label }}</div>
            </template>
            <div class="map-layer-content">
              <div
                v-for="(item2, index2) in item.children"
                :key="index2"
                :class="{
                  'map-layer-content-item': true,
                  active: item2.isChecked
                }"
                @click="handleTreeCheck(item2)"
              >{{ item2.label }}</div>
            </div>
          </el-collapse-item>
        </el-collapse>
      </div>
    </transition>
    <!-- 地图图层 e -->

    <el-dialog :close-on-click-modal="false" :visible.sync="dialogVisible">
      <img width="100%" :src="dialogImageUrl" />
    </el-dialog>

    <el-dialog
      class="shenchaBoxDialog"
      :close-on-click-modal="false"
      title="审查意见"
      :visible.sync="xianZhuangShenCha"
    >
      <div class="shenchaBox">
        <div class="shenchaBox_mainBox">
          <div class="shenchaBox_item">
            <p>问题类型：</p>
            <div class="shenchaBox_item_input">
              <el-select
                v-model="yijianObj.yijianValue"
                class="shenchaBox_item_input"
                placeholder="--请选择--"
                @change="changeWenTi"
              >
                <el-option
                  v-for="item in cuowuList"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code"
                />
              </el-select>
            </div>
          </div>
          <div v-show="showWenTiBox" class="shenchaBox_item">
            <p>问题内容：</p>
            <div class="shenchaBox_item_input">
              <el-input
                v-model="yijianObj.yijianContent"
                class="shenchaBox_item_input"
                type="textarea"
                placeholder="请输入内容"
                :rows="4"
              />
            </div>
          </div>
        </div>
      </div>
      <span v-if="!isLook" slot="footer" class="dialog-footer">
        <el-button @click="xianZhuangShenCha = false">取 消</el-button>
        <el-button
          v-loading.fullscreen.lock="fullscreenLoading"
          type="primary"
          element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.6)"
          @click="submitXianZhuang"
        >提 交</el-button>
      </span>
    </el-dialog>

    <!-- 卷帘 s -->
    <el-dialog
      class="side-by-side-popup"
      title="选择卷帘对比的图层"
      :close-on-click-modal="false"
      :visible.sync="sideBySidePopup"
    >
      <el-row :gutter="20">
        <el-col :span="12">
          <el-card header="左侧图层">
            <el-tree
              ref="leftTree"
              default-expand-all
              :data="$config.treeData"
              :expand-on-click-node="false"
              :highlight-current="true"
              :props="defaultProps"
              @node-click="handleSideBySideClick($event, 'left')"
            />
          </el-card>
        </el-col>
        <el-col :span="12">
          <el-card header="右侧图层">
            <el-tree
              ref="rightTree"
              default-expand-all
              :data="$config.treeData"
              :expand-on-click-node="false"
              :highlight-current="true"
              :props="defaultProps"
              @node-click="handleSideBySideClick($event, 'right')"
            />
          </el-card>
        </el-col>
      </el-row>
      <el-row>
        <el-button class="confirm-btn" @click="handleSideBySide">确定选择</el-button>
      </el-row>
    </el-dialog>
    <!-- 卷帘 e -->

    <!-- 项目审查弹窗 s -->
    <el-dialog
      class="project-dialog"
      :modal="false"
      custom-class="main-box"
      :close-on-click-modal="false"
      :visible.sync="projectDialog"
      width="760px"
      top="22vh"
    >
      <slot name="projectDialog" />
    </el-dialog>
    <!-- 项目审查弹窗 e -->
  </div>
</template>

<script>
import {
  LMap,
  LTileLayer,
  LPopup,
  LLayerGroup,
  LGeoJson,
  LFeatureGroup,
  LControl,
  LMarker
} from 'vue2-leaflet'

import 'leaflet/dist/leaflet.css'
import '@/icons/iconfont.css'
import 'leaflet.browser.print/dist/leaflet.browser.print'

// import icon from 'leaflet/dist/images/marker-icon.png'
// import iconShadow from 'leaflet/dist/images/marker-shadow.png'

// let DefaultIcon = L.icon({
//   iconUrl: icon,
//   shadowUrl: iconShadow
// })
// L.Marker.prototype.options.icon = DefaultIcon

import 'proj4leaflet/lib/proj4-compressed.js'
import 'proj4leaflet/src/proj4leaflet.js'

import '@/lib/leaflet/control.css'
import '@/lib/leaflet/control.js'

import { QScreenSwitcher } from '@/utils/common.js'

import { redlineData } from '@/api/feasibilityStudy/supervisionInformation.js'
import { getFile } from '@/api/common'

export default {
  name: 'TdMap',
  components: {
    LMap,
    LTileLayer,
    LPopup,
    LLayerGroup,
    LGeoJson,
    LFeatureGroup
  },
  props: [
    // "pkList",
    'isShowControls',
    'isShowScyjBtn',
    'isShowScWyBtn',
    'isShowXztBtn',
    'cuowuList',
    'yijianInfo',
    'isLook',
    'opinionType'
  ],
  data() {
    return {
      pkList: [],
      // 显示隐藏问题框
      showWenTiBox: true,
      yijianObj: {
        // 意见类型
        yijianValue: '',
        // 意见内容
        yijianContent: '',
        status: '' // 状态
      },
      // 审查现状图全屏加载
      fullscreenLoading: false,
      // 审查现状图
      xianZhuangShenCha: false,
      // 假装加载地图
      loadIfram: 1,
      // 现状图显示关闭
      mapIframe: false,
      // 显示四个输入框
      showThreeFlag: false,
      // 是否为缺失遗漏点
      isMissingReclaimPoint: 'NO',
      // 审定规模与送审规模是否一致
      isIdenticalScale: 'NO',
      // 切换选项卡
      tabFlag: 1,
      // 地图图层模式
      mapMode: 'yx', // yx影像；sl矢量
      // 地图弹层
      mapPopup: null,
      // geoJson style
      polygonStyleMap: {
        defaultStyle: {
          color: '#ff0000',
          weight: 1,
          fillOpacity: 0.2
        },
        activeStyle: {
          // color: "#ff6600",
          color: '#ff6600',
          weight: 2,
          fillOpacity: 0.2
        }
      },

      // 地图导航配置
      defaultProps: {
        children: 'children',
        label: 'label'
      },

      // 页面参数
      navActive: true,
      polygonArr: [],
      polygonMap: {},
      geoJsonArr: [],
      geoJsonOptions: {},
      popupActiveName: 'baseInfo',
      baseInfoData: null, // 基本信息数据
      jgInfoData: {
        // 监管信息数据
        xctk: null, // 现场踏勘
        xctkList: [],
        qqch: null, // 前期测绘
        qqchList: [],
        cgcs: null // 成果初审
      },
      jgInfoTabActiveName: 'xctk',
      jgInfoLoading: false,
      dialogVisible: false,
      dialogImageUrl: null,
      treeCheckedObj: {},
      control: {
        lineMeasure: null,
        areaMeasure: null,
        browserPrint: null,
        siderCompare: null
      },
      fullScreen: new QScreenSwitcher(),
      isFullScreen: false,

      isFalse: true,
      sideBySidePopup: false, // 卷帘对比选择弹窗
      sideBySideStatus: 'close',
      sideBySideUrl: {
        left: null,
        right: null
      },
      markerLatLng: null,
      searchValue: '', // 搜索值
      collapseValue: '1', // 折叠面板
      toolsValue: {
        // 地图工具开关状态
        layer: false,
        ruler: false,
        area: false,
        cut: false
      },
      currentPolygon: null,
      currentPkData: null, // 当前选中片块
      projectDialog: false, // 项目审查弹窗
      hxData: '', // 项目红线数据
      xzViewId: '', // 现状图路径
      xzViewPath: '',
      xzViewLoading: false,
      pickLatlngSwitch: false // 坐标拾取开关
    }
  },
  watch: {
    baseInfoData() {},
    xzViewPath(val) {
      const that = this
      this.loadIfram = 2
      this.xzViewLoading = true

      this.$nextTick(() => {
        const downFrame = document.getElementById('wode')
        downFrame.onload = function(e) {
          that.xzViewLoading = false
        }
      })
    }
  },
  mounted() {
    this.setRedLine()
  },
  methods: {
    // 定位到红线
    setRedLine() {
      // 获取地图
      var data = {
        projectId: localStorage.getItem('projectId')
      }
      redlineData(data).then(res => {
        const item = res.data
        this.getHxData(item)
      })
    },
    closeMapIframe() {
      // 关闭显示现状图的iframe
      this.mapIframe = false
    },
    closeXianZhuang() {
      // 关闭弹框
      this.xianZhuangShenCha = false
      this.fullscreenLoading = false
      this.yijianObj.yijianValue = ''
      this.yijianObj.yijianContent = ''
    },
    changeWenTi(v) {
      // 选择问题类型(用于无问题时隐藏输入意见框)
      if (v == 'NO_PROBLEM') {
        this.showWenTiBox = false
      } else {
        this.showWenTiBox = true
      }
    },
    shenchaAct() {
      // 审查现状图弹框
      if (this.yijianInfo.status == 'VIEW') {
        this.yijianObj.yijianValue = this.yijianInfo.yijianValue
        this.yijianObj.yijianContent = this.yijianInfo.yijianContent
        if (this.yijianObj.yijianValue == 'NO_PROBLEM') {
          this.showWenTiBox = false
        } else {
          this.showWenTiBox = true
        }
      } else if (this.yijianInfo.status == 'AUDIT') {
        this.yijianObj.yijianValue = ''
        this.yijianObj.yijianContent = ''
      }
      this.xianZhuangShenCha = true
    },
    submitXianZhuang() {
      var obj = {
        // 提交现状
        landId: this.currentPkData.landId,
        yijianValue: this.yijianObj.yijianValue,
        yijianContent: this.yijianObj.yijianContent
      }
      this.fullscreenLoading = true
      this.$parent.wentijilu(obj)
    },
    closeXzView() {
      // 关闭现状图
      // this.$parent.guanbiXianZhuang();
      this.mapIframe = false
    },
    handleFullScreen() {
      // 全屏
      if (this.isFullScreen) {
        this.fullScreen.exitFullScreen(document.getElementById('map-container'))
      } else {
        this.fullScreen.enterFullScreen(
          document.getElementById('map-container')
        )
      }
      this.isFullScreen = !this.isFullScreen
    },
    handleClear() {
      // 清除测距、面积测距
      const _lineMeasureLayer = this.control['lineMeasure']['_layerPaint']
      const _areaMeasureLayer = this.control['areaMeasure']['_layer']
      if (_areaMeasureLayer != null) {
        for (var k in _areaMeasureLayer['_layers']) {
          _areaMeasureLayer.removeLayer(_areaMeasureLayer['_layers'][k])
        }
      }
      if (_lineMeasureLayer != null) {
        _lineMeasureLayer.clearLayers()
      }

      this.toolsValue['ruler'] = false
      this.toolsValue['area'] = false
    },
    openSideBySidePopup() {
      // 打开卷帘对比
      if (this.sideBySideStatus == 'close') {
        this.sideBySidePopup = true
      } else {
        this.handleToolsSwitch('cut')
        this.$refs.map.mapObject.removeLayer(this.sideBySideUrl.left)
        this.$refs.map.mapObject.removeLayer(this.sideBySideUrl.right)
        this.control.siderCompare.remove()
        this.sideBySideStatus = 'close'
      }
    },
    handleSideBySideClick(e, name) {
      // 卷帘对比选择事件
      if (e.url) {
        this.sideBySideUrl[name] = e.url
      } else {
        this.sideBySideUrl[name] = null
        this.$message({
          message: `${name == 'left' ? '左侧' : '右侧'}所选图层暂无数据`,
          type: 'warning'
        })
      }
    },
    handleSideBySide() {
      // 卷帘对比
      if (this.sideBySideUrl.left == null) {
        this.$message({
          message: `左侧所选图层暂无数据`,
          type: 'warning'
        })
        return
      }
      if (this.sideBySideUrl.right == null) {
        this.$message({
          message: `右侧所选图层暂无数据`,
          type: 'warning'
        })
        return
      }
      const left = this.sideBySideUrl.left
      const right = this.sideBySideUrl.right
      this.$refs.map.mapObject.addLayer(left)
      this.$refs.map.mapObject.addLayer(right)
      this.control.siderCompare = L.control
        .sideBySide(left, right)
        .addTo(this.$refs.map.mapObject)
      this.sideBySidePopup = false
      this.sideBySideStatus = 'open'
      this.handleToolsSwitch('cut')
    },
    initMap() {
      const that = this
      this.$nextTick(() => {
        // 加载测距、面积测距、打印控件
        this.control.lineMeasure = L.control
          .lineMeasure({ drawBtn: document.getElementById('lineMeasure') })
          .addTo(this.$refs.map.mapObject)
        this.control.areaMeasure = L.control
          .areaMeasure({ drawBtn: document.getElementById('areaMeasure') })
          .addTo(this.$refs.map.mapObject)
        this.control.browserPrint = L.control
          .browserPrint({ el: document.getElementById('browserPrint') })
          .addTo(this.$refs.map.mapObject)

        this.$refs.map.mapObject.on('click', function(e) {
          if (that.pickLatlngSwitch) {
            that.$emit('throwPickObj', e)
            that.pickLatlngSwitch = false
            that.handleScView(true)
          }
        })
      })
    },
    changeMapMode(mode) {
      // 切换地图模式
      this.mapMode = mode
    },
    handleClickPolygon(e, item, index) {
      // 点击多边形开启片块详情popup
      this.$parent.getCurListIndex(index)
      this.baseInfoData = item
      this.$nextTick(() => {
        this.$refs.features.mapObject.openPopup([e.latlng.lat, e.latlng.lng])
      })
    },
    handleImageDialog(url) {
      this.dialogImageUrl = url
      this.dialogVisible = true
    },
    handleTreeCheck(item) {
      // 图层树点击事件
      if (item.disabled) {
        this.$message({
          message: `暂无图层`,
          type: 'warning'
        })
        return
      }
      if (item.url) {
        item.isChecked = !item.isChecked
        if (item.isChecked == true) {
          this.treeCheckedObj[item.id] = item.url
        } else {
          delete this.treeCheckedObj[item.id]
        }
      }
      this.$forceUpdate()
    },

    handleToolsSwitch(name) {
      // tools开关事件
      this.toolsValue[name] = !this.toolsValue[name]
    },

    handleScView(value) {
      this.projectDialog = value
    },

    handlePickLatlngSwitch(value) {
      this.pickLatlngSwitch = value
    },

    getHxData(item) {
      const _geoJsonArr = []
      item.feature
        ? (this.hxData = [item.feature])
        : (this.hxData = this.handleFeatureList(item.featureList))
      this.$nextTick(() => {
        this.$refs.geoJson.forEach((item, index) => {
          _geoJsonArr.push(item.getBounds())
        })
        this.geoJsonArr = _geoJsonArr
        this.$refs.map.fitBounds(this.geoJsonArr)
      })
    },

    handleFeatureList(list) {
      const arr = []
      list.forEach(item => {
        arr.push(item.feature)
      })
      return arr
    },

    handleXzView(item) {
      this.xzViewId = item.fileId
      getFile({
        fileId: this.xzViewId
      }).then(res => {
        this.xzViewPath =
          this.$httpsCad + '/?url=' + this.$https + res.data.filePath
        this.mapIframe = true
      })
    }
  },
  created() {
    this.initMap()
  }
}
</script>

<style lang="scss" scoped>
.map-container {
  position: relative;
  display: flex;
  justify-content: center;
  // height: calc(100vh - 200px);
  height: 100%;
  // margin-top: 30px;
  margin-bottom: 30px;
}

.map-left {
  width: 0;
  border: 1px solid #e9e9e9;
  border-right: none;

  &.active {
    width: 230px;
  }
}

.map-nav {
  background: #f2f2f2;
  height: 40px;
  border-bottom: 1px solid #e9e9e9;
  overflow: hidden;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  color: #4d4d4d;
  line-height: 40px;
}

.map-right {
  width: 100%;
}

.map-mode {
  display: flex;
  flex-direction: row;
  width: auto;
  height: 62px;
  overflow: hidden;
  font-size: 0;
  position: absolute;
  z-index: 500;
  right: 0;
  bottom: 30px;

  &-item {
    position: relative;
    width: 62px;
    height: 62px;
    display: block;
    overflow: hidden;
    border: 1px solid #308be7;
    margin-right: 10px;
    cursor: pointer;

    .text {
      background: rgba(0, 0, 0, 0.5);
      width: 100%;
      height: 20px;
      display: block;
      overflow: hidden;
      font-size: 13px;
      color: #fff;
      text-align: center;
      line-height: 20px;
      position: absolute;
      left: 0;
      bottom: 0;
      z-index: 1;
    }
  }

  &-item.yx {
    background: url('../../assets/map/type-img-icon.png');
    background-repeat: no-repeat;
    background-size: cover;
  }

  &-item.sl {
    background: url('../../assets/map/type-vector-icon.png');
    background-repeat: no-repeat;
    background-size: cover;
  }
}

.nav-switch {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  background: #fff;
  width: 20px;
  height: 30px;
  border: 1px solid #ccc;
  border-left: 0 none;
  display: block;
  overflow: hidden;
  font-size: 18px;
  text-align: center;
  line-height: 30px;
  position: absolute;
  z-index: 1001;
  border-radius: 0 5px 5px 0;
  cursor: pointer;
}

.popup-tab {
  position: relative;

  ul {
    margin: 0;
    padding: 0;
    list-style: none;
    height: 330px;
    overflow-y: auto;
  }

  li {
    font-size: 14px;
    color: #444;
    min-height: 30px;
    padding: 10px 10px;
  }

  .no-data {
    width: 100%;
    overflow: hidden;
    color: #444;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.5;
    padding: 0 10px;
    text-align: center;
    margin: 35px 0;
    clear: both;
  }
}

.popup-jg-tab {
  height: 330px;
  overflow-y: auto;

  .one-item {
    height: 30px;
    overflow: hidden;
    font-size: 13px;
    color: #999;
    line-height: 30px;
  }

  .one-item.check /deep/ .el-checkbox__input.is-checked + .el-checkbox__label {
    font-size: 14px;
    color: #12203e;
  }

  .table-box {
    margin-top: 10px;
  }
}

.one-item.check {
  margin-bottom: 10px;
}

.popup-jg-tab /deep/ .el-card__body {
  padding: 0;
}

.map-box {
  display: flex;
  flex-direction: row;
  position: absolute;
  z-index: 500;
  left: 30px;
  top: 30px;

  .map-tools {
    width: auto;
    border-radius: 4px;
    box-shadow: 1px 1px 2px #666;
    overflow: hidden;
    font-size: 0;
    cursor: pointer;

    &-item {
      position: relative;
      float: left;
      background: #fff;
      // width: 40px;
      padding: 0 12px;
      // border-bottom: 1px solid #efefef;
      overflow: hidden;
      height: 36px;
      line-height: 36px;
      font-size: 0;
      color: #666;
      text-align: center;
      // border-right: 1px solid #e6e6e6;

      &.line:after {
        position: absolute;
        display: block;
        content: '';
        top: 50%;
        transform: translateY(-50%);
        left: 0;
        width: 1px;
        height: 18px;
        background: rgba(230, 230, 230, 1);
      }

      i {
        color: #666;
        display: block;
      }

      .svg-icon {
        display: block;
        font-size: 24px;
        height: 36px;
        color: #666;
      }

      &.active {
        i {
          color: #409eff;
        }
      }

      &:hover {
        background: #efefef;
      }
    }
  }

  .map-button-group {
    display: flex;
    border-radius: 4px;
    box-shadow: 1px 1px 2px #666;
    overflow: hidden;
    height: 100%;
    font-size: 0;
    margin-left: 10px;

    .line:after {
      position: absolute;
      display: block;
      content: '';
      top: 50%;
      transform: translateY(-50%);
      left: 0;
      width: 1px;
      height: 18px;
      background: rgba(230, 230, 230, 1);
    }

    /deep/ .el-button-group {
      position: relative;
      margin-left: 10px;
      border-radius: 4px;
      box-shadow: 1px 1px 2px #666;
    }

    /deep/ .el-button {
      border: 1px solid #fff;
    }

    /deep/ .el-input__inner {
      width: 344px;
      border-radius: 4px;
      box-shadow: 1px 1px 2px #666;
    }

    /deep/ .el-input__inner {
      height: 36px;
      border: none;
    }

    /deep/ .el-input__icon {
      font-size: 18px;
      line-height: 36px;
      color: #999;
    }
  }
}

.map-search {
  position: absolute;
  z-index: 500;
  left: 30px;
  top: 30px;
  font-size: 0;
  display: flex;
  flex-direction: row;

  .line:after {
    position: absolute;
    display: block;
    content: '';
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    width: 1px;
    height: 18px;
    background: rgba(230, 230, 230, 1);
  }

  /deep/ .el-button-group {
    position: relative;
    margin-left: 10px;
    border-radius: 4px;
    box-shadow: 1px 1px 2px #666;
  }

  /deep/ .el-button {
    border: 1px solid #fff;
  }

  /deep/ .el-input__inner {
    width: 344px;
    border-radius: 4px;
    box-shadow: 1px 1px 2px #666;
  }

  /deep/ .el-input__inner {
    height: 36px;
    border: none;
  }

  /deep/ .el-input__icon {
    font-size: 18px;
    line-height: 36px;
    color: #999;
  }

  ::-webkit-input-placeholder {
    /* WebKit browsers */
    color: #b3b3b3;
    font-size: 14px;
  }

  ::-moz-placeholder {
    /* Mozilla Firefox 19+ */
    color: #b3b3b3;
    font-size: 14px;
  }

  :-ms-input-placeholder {
    /* Internet Explorer 10+ */
    color: #b3b3b3;
    font-size: 14px;
  }
}

.map-layer {
  width: 392px;
  position: absolute;
  z-index: 1001;
  left: 30px;
  top: 86px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 1px 1px 2px #666;

  /deep/ .el-collapse-item__header {
    // background-color: #f5f5f5;
    height: 40px;
    line-height: 40px;
    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.2);
  }

  /deep/ .el-collapse-item__wrap {
    background-color: rgba(255, 255, 255, 0.8);
  }

  /deep/ .el-collapse-item__arrow {
    margin: 0 18px 0 auto;
  }

  &-title {
    position: relative;
    font-size: 16px;
    font-family: PingFang SC;
    font-weight: 500;
    color: rgba(77, 77, 77, 1);
    margin-left: 28px;

    &::before {
      content: '';
      position: absolute;
      display: block;
      width: 3px;
      height: 16px;
      background: rgba(21, 112, 213, 1);
      top: 50%;
      left: -8px;
      transform: translateY(-50%);
    }
  }

  /deep/ .el-collapse-item__content {
    padding-bottom: 0;
  }

  &-content {
    display: flex;
    flex-wrap: wrap;
    padding: 20px;

    &-item {
      font-size: 15px;
      font-family: PingFang SC;
      font-weight: 500;
      color: rgba(102, 102, 102, 1);
      margin-right: 24px;
      transition: all 0.3s;
      cursor: pointer;

      &:hover {
        color: #409eff;
      }

      &.active {
        color: #409eff;
      }
    }
  }
}

.leaflet-control-browser-print {
  display: none;
}

.side-by-side-popup {
  text-align: center;

  .confirm-btn {
    margin-top: 26px;
  }

  /deep/
    .el-tree--highlight-current
    .el-tree-node.is-current
    > .el-tree-node__content {
    // background-color: #f9b5a3;
    background-color: rgb(160, 207, 255);
  }
}

.piankuaiBox_select {
  display: flex;
  margin-top: 20px;
  margin-left: 20px;
  .piankuaiBox_select_item {
    width: 88px;
    height: 36px;
    background: #fff;
    opacity: 1;
    border-radius: 4px;
    color: #999999;
    text-align: center;
    line-height: 36px;
    font-size: 14px;
    margin-right: 8px;
    cursor: pointer;
  }
  .piankuaiBox_select_item.active {
    background: rgba(238, 243, 248, 1);
    color: #1d88f3;
  }
}

.piankuaihao {
  font-size: 20px;
  line-height: 28px;
  padding: 10px 0 21px 0;
  color: #333333;
  margin-left: 21px;
  border-bottom: 1px solid #f2f2f2;
}

.jibenxinxi {
  padding-bottom: 60px;
  height: 300px;
  overflow-x: hidden;
  overflow-y: auto;
  ul {
    list-style: none;
    overflow: hidden;
    padding-left: 10px;
    margin-top: 30px;
    li {
      float: left;
      color: #b3b3b3;
      font-size: 13px;
      margin-right: 40px;
      margin-bottom: 16px;
      span {
        color: #666666;
      }
      .redText {
        color: red;
      }
    }
  }
}

.zonghexinxiFirst {
  display: flex;
  margin-top: 30px;
  .zonghexinxiLeft {
    width: 88px;
    font-size: 14px;
    color: #333333;
  }
}

.zonghexinxiItem {
  margin-left: 20px;
}

.item-box-box {
  display: flex;
  .item-box-box-left {
    width: 82px;
    font-size: 13px;
    color: #b3b3b3;
  }
}

.one-item-item {
  margin-bottom: 21px;
}

.item-box-firstItem {
  font-size: 13px;
  color: #b3b3b3;
}

.table-box {
  overflow: hidden;
  .table-box-item {
    float: left;
    margin-right: 10px;
    margin-bottom: 10px;
  }
}

.table-box-left {
  font-size: 13px;
  color: #b3b3b3;
}

.jibenxinxi .ziliaoList {
  overflow: hidden;
  margin-top: 0;
  padding-left: 0;
  li {
    float: left;
    font-size: 13px;
    color: #1d88f3;
    margin-left: 18px;
    margin-right: 0;
    cursor: pointer;
  }
}

.yijianBox-item {
  margin-bottom: 20px;
  font-size: 14px;
  color: #666666;
  display: flex;
  .yijianBox-item-left {
    margin-right: 30px;
  }
}

.jibenxinxiyijian {
  margin-top: 33px;
  margin-left: 10px;
}

.submityijian {
  margin-top: 60px;
}

.iframeLoad {
  display: flex;
  font-size: 35px;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.map-iframe {
  opacity: 0.5;
  position: absolute;
  top: 0;
  right: 0;
  z-index: 501;
  width: 50%;
  height: 100%;
  box-sizing: border-box;
  padding-top: 40px;
  background-color: #fff;
  .shenchaButton {
    position: absolute;
    top: 10px;
    right: 10px;
  }
}
.map-iframe:hover {
  opacity: 1;
}

.shenchaBox {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.shenchaBox_item_input {
  width: 300px;
}

.shenchaBox_item_button {
  width: 300px;
  display: flex;
  justify-content: center;
  margin-top: 20px;
  margin-bottom: 50px;
}

.shenchaBoxDialog /deep/ .el-dialog {
  width: 500px;
}

.project-dialog {
  /deep/ .el-dialog__header {
    padding: 0;
  }

  /deep/ .el-dialog__body {
    padding: 0;
  }

  /deep/ .el-dialog__headerbtn {
    top: 14px;
    right: 14px;
    z-index: 9999;
  }
}
</style>
